<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib uri="http://www.springframework.org/tags" prefix="spring"%>
<%@ taglib uri="/mytaglib" prefix="code"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%
String path = request.getContextPath();
 %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title></title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<link rel="stylesheet" type="text/css"
	href="<c:url value="/static/jquery-easyui/themes/default/easyui.css"/>">
<link rel="stylesheet" type="text/css"
	href="<c:url value="/static/jquery-easyui/themes/icon.css"/>">
<script type="text/javascript"
	src="<c:url value="/static/jquery-easyui/jquery-1.6.min.js"/>"></script>
<script type="text/javascript"
	src="<c:url value="/static/jquery-easyui/jquery.easyui.min.js"/>"></script>
<script type="text/javascript"
	src="<c:url value="/static/jquery-easyui/plugins/jquery.panel.js"/>"></script>
<script type="text/javascript"
	src="<c:url value="/static/jquery-easyui/plugins/jquery.datagrid.js"/>"></script>
<script type="text/javascript"
	src="<c:url value="/static/jquery-easyui/plugins/jquery.messager.js"/>"></script>
<script type="text/javascript"
	src="<c:url value="/static/jquery-easyui/ext-for-framework.js.jsp"/>"></script>
<script type="text/javascript"
	src="<c:url value="/static/jquery-easyui/locale/easyui-lang-zh_CN.js"/>"></script>
<script type="text/javascript"
	src="<c:url value="/jsp/base/queryCode.js"/>"></script>
<script type="text/javascript">

	$(document).ready(function(){
	
		var cifCusId='<%=request.getParameter("cifCusId")%>';
		//alert(cifCusId);
		/* $("#myForm").form('load',
		'../../customer/getsifcusinfo.do?cifCusId=2315'); */
		$.ajax({
			url : "<c:url value='/customer/getsifcusinfo.do' />",
			async : true,
			data : {
				cifCusId : cifCusId
			},
			dataType : 'json',
			success : function(data) {
				
				$('#certs').datagrid('loadData', data.certs);
				$('#conns').datagrid('loadData', data.conns);
				$('#addresss').datagrid('loadData', data.addresss);
				
			},
			error : function() {
				$.messager.alert('通知', "错误");
			}

		});
	});
	function formatterCert(value, rowData, index, field) {
		var JsonData = "";
		$.ajax({
			url : "<c:url value='/datadictionary/getcodename.do'/>",
			async : false,
			data : {
				codeId : value,
				codeTypeId : "certificate_type"
			},
			dataType : 'json',
			success : function(data) {
				JsonData = data.codeName;
			}

		});
		return JsonData;
	}
	function formatterConns(value, rowData, index, field) {
		var JsonData = "";
		$.ajax({
			url : "<c:url value='/datadictionary/getcodename.do'/>",
			async : false,
			data : {
				codeId : value,
				codeTypeId : "contact_type"
			},
			dataType : 'json',
			success : function(data) {
				JsonData = data.codeName;
			}

		});
		return JsonData;
	}
	function formatterAddresss(value, rowData, index, field) {
		var JsonData = "";
		$.ajax({
			url : "<c:url value='/datadictionary/getcodename.do'/>",
			async : false,
			data : {
				codeId : value,
				codeTypeId : "address_type"
			},
			dataType : 'json',
			success : function(data) {
				JsonData = data.codeName;
			}

		});
		return JsonData;
	}
	function formatCombobox(obj,uri){   
	 	obj.combobox({
			url:uri,
			valueField:"codeId",
	        textField:"codeName", 
	        method:"get",
	        editable:false,
	        panelHeight:"auto",
	        disabled:true
	        /* ,
	        display:none */
	    });
	}
</script>


</head>
<body>
	<div class="easyui-panel" title="基本信息">
		<form id="baseCus" method="post">
				<table style="border: 0px">
					<tr>
						<td>主客户CIFID:</td>
						<td>${customer.baseCus.cifCusId}</td>
						<td width="200px"></td>
						<td>客户姓名:</td>
						<td>${customer.baseCus.cusName}</td>
						<td width="200px"></td>
						<td>性别:</td>
						<td ><code:codeName codeTypeId="gender" codeId="${customer.baseCus.gender}"/></td>
				
				<td width="200px"></td>
						<td> 出生日期:</td>
						<td id="birthday"><fmt:formatDate value="${customer.baseCus.birthday}" pattern="yyyy-MM-dd"/> </td>
					</tr>
				</table>
		</form>
	</div>
	<br/>
	<table id="certs" class="easyui-datagrid" iconCls="icon-list"
		singleSelect="false" fitColumns="true" idField="id" sortName="certTypeId" remoteSort="false" sortOrder="asc"
		loadMsg="请稍候......" title="证件信息">
		<thead>
			<tr>
				<th field="certTypeId" formatter="formatterCert" width="80"
					sortable="true" editor="text">证件类型</th>

				<th field="certNo" width="80" sortable="true" editor="text">
					证件号码</th>
				<th field="certExpireDate" width="80" sortable="true" editor="text">失效日期</th>
				<th field="updateTime" width="80" sortable="true" editor="text">
					更新日期</th>

			</tr>
		</thead>
	</table>
	<br/>
	<div class="easyui-panel" title="社会及健康属性">
		<form id="bodyattr" method="post">
		<table style="border: 0px">
			<tr>
				<td>身高(cm):</td>
				<td>${customer.bodyAttribute.height}</td>
				<td width="200px"></td>
				<td >体重(kg):</td>
				<td>${customer.bodyAttribute.weight}</td>
				<td width="300px"></td>
				<td>是否吸烟:</td>
				<td><code:codeName codeTypeId="is_smoking" codeId="${customer.bodyAttribute.isSmoking}"/></td>
			</tr>
			<tr>
				<td>国籍:</td>
				<td><code:codeName codeTypeId="country" codeId="${customer.socialAttribute.country}"/></td>
				<td width="200px"></td>
				<td>民族:</td>
				<td><code:codeName codeTypeId="nation" codeId="${customer.socialAttribute.nationId}"/></td>
				<td width="200px"></td>
				<td>婚姻状况:</td>
				<td><code:codeName codeTypeId="nation" codeId="${customer.socialAttribute.marriageId}"/></td>
			</tr>
			<tr>
				<td>学历:</td>
				<td><code:codeName codeTypeId="nation" codeId="${customer.workAttribute.degreeId}"/></td>
				<td width="200px"></td>
				<td>工作单位:</td>
				<td>${customer.workAttribute.workUnit}</td>
				<td width="200px"></td>
				<td >年收入:</td>
				<td>${customer.workAttribute.yearIncome}</td>
			</tr>
		</table>
		</form>
	</div>
<br/>

	<table id="conns" class="easyui-datagrid" iconCls="icon-list"
		singleSelect="false" fitColumns="true" idField="id"
		loadMsg="请稍候......" title="联系信息" sortName="conTypeId" remoteSort="false" sortOrder="asc" >
		<thead>
			<tr>
				<th field="conTypeId" formatter="formatterConns" width="80"
					sortable="true" editor="text" sortable="true">联系方式类型</th>

				<th field="contact" width="80" formatter="" sortable="true"
					editor="text">联系方式</th>
				<th field="updateTime" width="80" sortable="true" editor="text">
					更新日期</th>

			</tr>
		</thead>
	</table>
	<br/>
	<table id="addresss" class="easyui-datagrid" iconCls="icon-list"
		singleSelect="false" fitColumns="true" idField="id" sortName="addTypeId" remoteSort="false" sortOrder="asc"
		loadMsg="请稍候......" title="地址信息">
		<thead>
			<tr>
				<th field="addTypeId" formatter="formatterAddresss" width="80"
					sortable="true" editor="text">地址类型</th>

				<th field="address" width="80" sortable="true" editor="text">
					地址</th>
				<th field="updateTime" width="80" sortable="true" editor="text">
					更新日期</th>

			</tr>
		</thead>
	</table>
<br/>

</body>
</html>